{include file="public/_meta" /}
<link href="__PUBLIC_ADMIN__css/plugins/iCheck/custom.css"
	rel="stylesheet">
</head>

<body class="gray-bg">
	<div class="wrapper wrapper-content animated fadeInRight">
		<div class="ibox-title">
			<h5>编辑题目</h5>
			<div class="ibox-tools">
				<a href="{:url('admin/jjcc/topic_list')}"
					class="btn btn-primary btn-xs">返回列表</a>
			</div>
		</div>
		<div class="row">
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
					<div class="ibox-content">
						<form action="{:url('admin/jjcc/topic_edit_post')}" method="post" class="form-horizontal"enctype="multipart/form-data">
							<input type="hidden" name="id" value="{$res.id}" />
							<div class="hr-line-dashed"></div>
							<div class="form-group">
								<label class="col-sm-2 control-label">题目难度：</label>
								<div class="col-sm-2">
									<select class="form-control" name="type">
										<option value="1" class="dis"  {if condition="$res.type == 1"} selected="selected"{/if}>难度一</option>
										<option value="2" class="str"  {if condition="$res.type == 2"} selected="selected"{/if}>难度二</option>
										<option value="3" class="str"  {if condition="$res.type == 3"} selected="selected"{/if}>难度三</option>
										<option value="4" class="str"  {if condition="$res.type == 4"} selected="selected"{/if}>难度四</option>
									</select>
								</div>
							</div>
							<div class="hr-line-dashed"></div>
							<div class="form-group">
								<label class="col-sm-2 control-label">题目一：</label>
								<div class="col-sm-1">
									<input type="text" class="form-control" value="{$res.topic1}" name="topic1">
								</div>
							</div>
							<div class="hr-line-dashed"></div>
							<div class="form-group">
								<label class="col-sm-2 control-label">算法选择：</label>
								<div class="col-sm-1">
									<select class="form-control" name="answer">
										<option value="1" class="dis" {if condition="$res.answer == 1"} selected="selected"{/if}>+</option>
										<option value="2" class="str" {if condition="$res.answer == 2"} selected="selected"{/if}>-</option>
										<option value="3" class="str" {if condition="$res.answer == 3"} selected="selected"{/if}>*</option>
										<option value="4" class="str" {if condition="$res.answer == 4"} selected="selected"{/if}>/</option>
									</select>
								</div>
							</div>
							<div class="hr-line-dashed"></div>
							<div class="form-group">
								<label class="col-sm-2 control-label">题目二：</label>
								<div class="col-sm-1">
									<input type="text" class="form-control" value="{$res.topic2}" name="topic2">
								</div>
							</div>
							<div class="hr-line-dashed"></div>
							<div class="form-group">
								<label class="col-sm-2 control-label">等于：</label>
								<div class="col-sm-1">
									<input type="text" class="form-control" value="=" name=""  disabled="disabled">
								</div>
							</div>
							<div class="hr-line-dashed"></div>
							<div class="form-group">
								<label class="col-sm-2 control-label">结果：</label>
								<div class="col-sm-1">
									<input type="text" class="form-control" value="{$res.topic3}" name="topic3">
								</div>
							</div>
							<div class="hr-line-dashed"></div>
							<div class="form-group">
								<div class="col-sm-4 col-sm-offset-2">
									<button class="btn btn-primary" type="submit">保存内容</button>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>

	{include file="public/_footer" /}

	<!-- 自定义js -->
	<script src="__PUBLIC_ADMIN__js/content.js?v=1.0.0"></script>
	<script type="text/javascript" charset="utf-8"
		src="__PUBLIC_ADMIN__utf8-php/ueditor.config.js"></script>
	<script type="text/javascript" charset="utf-8"
		src="__PUBLIC_ADMIN__utf8-php/ueditor.all.min.js"></script>
	<!-- iCheck -->
	<script src="__PUBLIC_ADMIN__js/plugins/iCheck/icheck.min.js"></script>

	<script>
        $(document).ready(function() {
        	$('.i-checks').iCheck({
                checkboxClass: 'icheckbox_square-green',
                radioClass: 'iradio_square-green',
            });
			
            $('.refresh').click(function(){
            	//window.location.reload();	// 刷新页面
            })
		});
	</script>
	<script
		src="__PUBLIC_ADMIN__meeting/js/plugins/layer/laydate/laydate.js"></script>
	<script>
        //外部js调用
        laydate({
            elem: '#hello', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
            event: 'focus' //响应事件。如果没有传入event，则按照默认的click
        });

        //日期范围限制
        var start = {
            elem: '#start',
            format: 'YYYY/MM/DD hh:mm:ss',
            min: laydate.now(), //设定最小日期为当前日期
            max: '2099-06-16 23:59:59', //最大日期
            istime: true,
            istoday: false,
            choose: function (datas) {
                end.min = datas; //开始日选好后，重置结束日的最小日期
                end.start = datas //将结束日的初始值设定为开始日
            }
        };
        var end = {
            elem: '#end',
            format: 'YYYY/MM/DD hh:mm:ss',
            min: laydate.now(),
            max: '2099-06-16 23:59:59',
            istime: true,
            istoday: false,
            choose: function (datas) {
                start.max = datas; //结束日选好后，重置开始日的最大日期
            }
        };
        laydate(start);
        laydate(end);
    </script>
	<script>
        $('.addInput').click(function(){
            var str = '';
            var str = '<input style="margin-top:5px;" type="text" class="form-control inputType" value="" name="grade[]">';
            $(".inputType").eq(-1).after(str);
        })
    
    </script>
</body>
</html>
